<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="common/header.jsp" %>
<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>新增APP版本信息 <small><i class="fa fa-user"></i>${userSession.devName}</h2>
                <div class="clearfix"></div>
            </div>
            <div class="x_title">
                <h2>历史版本列表</h2>
                <div class="clearfix"></div>
            </div>
            <div class="x_content1">
                <div class="clearfix"></div>
                <p class="text-muted font-13 m-b-30"></p>
                <div id= "datatable-responsive_wrapper"
                     class= "dataTables_wrapper form-inline dt-bootstrap no-footer">
                    <div class= "row">
                        <div class="col-sm-12">
                            <table id="datatable-responsive" class="table table-striped table-bordered dt-responsive"
                                   cellspacing="0" width= "100%" role= "grid" aria-describedby= "datatable-responsive info">
                                <thead>
                                <th class= "sorting" tabindex="0"
                                    aria-controls= "datatable-responsive" rowspan= "1" colspan= "1"
                                    style="width: 50px;"
                                    aria-label="Last name: activate to sort column ascending">软件名称</th>
                                <th class= "sorting" tabindex="0"
                                    aria-controls= "datatable-responsive" rowspan= "1" colspan= "1"
                                    style="width: 50px;"
                                    aria-label="Last name: activate to sort column ascending">版本号</th>
                                <th class= "sorting" tabindex="0"
                                    aria-controls= "datatable-responsive" rowspan= "1" colspan= "1"
                                    style="width: 50px;"
                                    aria-label="Last name: activate to sort column ascending">版本大小（单位：M）</th>
                                <th class= "sorting" tabindex="0"
                                    aria-controls= "datatable-responsive" rowspan= "1" colspan= "1"
                                    style="width: 50px;"
                                    aria-label="Last name: activate to sort column ascending">发布状态</th>
                                <th class= "sorting" tabindex="0"
                                    aria-controls= "datatable-responsive" rowspan= "1" colspan= "1"
                                    style="width: 50px;"
                                    aria-label="Last name: activate to sort column ascending">APK文件下载</th>
                                <th class= "sorting" tabindex="0"
                                    aria-controls= "datatable-responsive" rowspan= "1" colspan= "1"
                                    style="width: 50px;"
                                    aria-label="Last name: activate to sort column ascending">最新更新时间</th>
                                </thead>
                                <tbody>
                                    <c:forEach var= "appVersion" items= "${ appVersionList }" varStatus="status">
                                    <tr role= "row" class= "odd">
                                        <td tabindex="0" class= "sorting_1 ">${appVersion.appName}</td>
                                        <td>${ appVersion.versionNo }</td>
                                        <td>${ appVersion.versionSize }</td>
                                        <td>${appVersion.publishStatusName }</td>
                                        <td>
                                            <a href="${appVersion.downloadLink }">${appVersion.apkFileName }</a>
                                        </td>
                                        <td><fmt : formatDate value="${appVersion.modifyDate }" pattern= "yy-MM-dd"/></td>
                                    </tr>
                                    </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                    <div class="x_title">
                        <h2>新增版本信息</h2>
                        <ul class="nav navbar-right panel_toolbox">
                            <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                        </ul>
                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content" style="display: block">
                        <br>
                        <form class="form-horizontal form-LabeL-left"
                              action= "addversionsave" method= "post" enctype="multipart/form-data">
                            <input type="hidden" id="appId" name="appId" value="${version.appId}"/>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="versionNo">版本号 <span class="required">*</span>
                                </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <input id="versionNo" type="text" name="versionNo"
                                           placeholder="请输入版本号" required="required"
                                           class="optional form-control col-md-7 col-xs-12">
                                </div>
                            </div>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="versionSize">版本大小 <span class="required">*</span>
                                </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <input id="versionSize" type="number" name="versionSize"
                                           placeholder="请输入版本大小（单位：Md）" data-validate-minmax= "10,500"
                                           class="optional form-control col-md-7 col-xs-12">
                                </div>
                            </div>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="publishStatus">发布状态 <span class="required">*</span>
                                </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                   <input type="hidden" name="publishStatus" id="publishStatus" value="3"/>预发布
                                </div>
                            </div>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="versionInfo">版本简介<span class="required">*</span>
                                </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                            <textarea id="versionInfo" required="required" name="versionInfo"
                                      placeholder="请输入版本的相关信息，本信息作为版本的详细信息进行版本的介绍"
                                      class="form-control col-md-7 col-xs-12"></textarea>
                                </div>
                            </div>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="a_downLoadLink">apk文件<span class="required">*</span>
                                </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <input type="file" id="a_downLoadLink" class="form-control col-md-7 col-xs-12" name="a_downLoadLink" required="required">
                                    ${fileUpLoadError}
                                </div>
                            </div>
                            <div class="ln_solid"></div>
                            <div class="form-group">
                                <div class="col-md-6 col-md-offset-3">
                                    <button type="submit" class="btn btn-primary">保存</button>
                                    <button id="back" type="button" class="btn btn-success">返回</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>
</div></div>
</div>
<%@include file="common/footer.jsp" %>
<script src= "${pageContext.request.contextPath }/statics/localjs/appversionadd.js"></script>